<template>
	<div>
		<div class="detail" @click="pathpush">
			<img :src="detailitem.img" alt="" class="imgs" />
			<p>{{ detailitem.name }}</p>
		</div>
	</div>
</template>

<script>
export default {
	methods: {
		pathpush() {
			// 解决二次点击报错问题
			if (this.$route.path != `/article/${this.detailitem.id}`) {
				this.$router.push(`/article/${this.detailitem.id}`);
			}
		}
	},
	props: ['detailitem']
};
</script>

<style scoped>
.imgs {
	width: 100%;
}
.detail p {
	font-size: 12px;
}
</style>
